#include "SceneLayer.h"
#include <SECore/CoreApplication.h>
#include <SEngine/Render/Descriptors/SceneDescriptor.h>
#include <SEngine/Project/Project.h>

namespace SEngine
{
    SceneLayer::SceneLayer(CoreApplication &app)
        : Layer(app)
    {
    }

    void SceneLayer::Attach()
    {
        m_scene = m_app.GetDescriptor<Project>()->get().GetScene();
    }
    
    void SceneLayer::BeginFrame()
    {
        m_scene->OnBeforeUpdate();
    }

    void SceneLayer::EndFrame()
    {
        m_scene->OnAfterUpdate();
    }

    void SceneLayer::Update(int delta)
    {
        m_scene->OnUpdate(delta);
    }
} // namespace SEngine
